package er;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Objects;
import java.util.Scanner;

public class NumberNine {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String next = scanner.next();
        long count=0;
        try (
                BufferedReader bufferedReader=new BufferedReader(new FileReader("g:/file/niuma.txt"));
                ){
            int len=-1;
            while ((len=bufferedReader.read())!=-1){
                char c= (char) len;
                String s = Character.toString(c);
                if (Objects.equals(next,s)){
                    count++;
                }
            }
        }catch (IOException e){
            e.printStackTrace();
        }
        System.out.println(count);
    }
}
